<!--
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				ProjectGroup.jsp
  //	TITLE:				Local Cost
  //	FUNCTION:			Add or Update Project Group.
  //	BY:				Poly Li
  //	DATE:				14-01-2004
  // --------------------------------------------------------------
-->

<%@ include file="../tssheader.jsp" %>
<%@ page import="tss.projectgroup.*" %>
<%@ page import="tss.options.*" %>
<%@ page import="java.text.SimpleDateFormat" %>
<%@ page import="java.util.Date" %>

<script language="JavaScript" >

function formValidation()
{
	if(isNull(fm.project_name," Project name ") )
		return false;
	if(isNull(fm.group_name," Group name ") )
		return false;
	return true;
}

</script>

<%
	//Get A Project Group Code list
	ProjectOptions projectOptions = new ProjectOptions();
	GroupOptions groupOptions = new GroupOptions();

    //Get A Project
    ProjectGroupBean projectGroup = (ProjectGroupBean)request.getAttribute("projectGroups");
    if (projectGroup == null)
       projectGroup = new ProjectGroup();
    boolean readonlyFlag = true;
    formAction = request.getParameter("formAction");
    if (formAction.equals("Create"))
	{
		readonlyFlag = false;
        }

%>
<body>

<h2>Project Group Maintenance</h2>
<form id=fm method=post action=<%=contextPath%>/servlet/tss.projectgroup.ProjectGroupServlet >
<input type=hidden name=formAction value=<%=formAction%> >
<table cols=10 border=0 >
<tr>
  <td>Project name</td>
  <td>
	<select name=project_name>
	  <%=projectOptions.getOptions(projectGroup.getProject_name(),readonlyFlag)%>
	</select>
  </td>
</tr>

<tr>
  <td>Group name</td>
  <td>
	<select name=group_name>
	<%=groupOptions.getOptions(projectGroup.getGroup_name(),readonlyFlag)%>
	</select>  
  </td>
</tr>


</table>
<hr>

<p>
  <INPUT type=button value=Save onclick="save()" >
  <INPUT type=button value=Delete  onclick="deleteRecord()"  >
   <INPUT type=reset  value=Cancel >
 <INPUT type=button value=Back onclick=history.back() >

</p>
</form>
<%@ include file="../tssfooter.jsp" %>
</body>
</body>
</html>

